package cn.wolfcode.crm.domain;

import com.alibaba.fastjson.JSON;
import lombok.Data;

import java.util.Date;
import java.util.HashMap;

@Data
public class CourseOrder {
    private Long id;

    //录入时间
    private Date inputTime;

    //费用
    private Long money;


    //客户
    private Customer customer;
    //课程/学科
    private SystemDictionaryItem course;


    public String getJson() {
        HashMap map = new HashMap();
        map.put("id", id);
        map.put("inputTime", inputTime);
        map.put("money", money);
        if (customer != null) {
            map.put("customer", customer.getId());
        }
        if (course != null) {
            map.put("course", course.getId());
        }
        return JSON.toJSONString(map);
    }

}